package com.systemdevelopment.mainproject.View.demo;

import com.systemdevelopment.mainproject.Controller.ControllerFactory;
import com.systemdevelopment.mainproject.Controller.UserController;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.stage.Stage;

public class HelloController {
    @FXML
    public Label welcomeText;
    public TextField nameField;
    public PasswordField passwordField;
    @FXML
    protected void onHelloButtonClick() {
        welcomeText.setText("Welcome to JavaFX Application!");
    }
    @FXML
    protected  void onLoginButtonClick() {
        //nameField.setText("这是登陆按钮");
        String id=nameField.getText();
        String pwd=passwordField.getText();
        Stage stage = (Stage) nameField.getScene().getWindow();
        FXMLLoader fxmlLoader2 = new FXMLLoader(HelloApplication.class.getResource("Homepage.fxml"));
        try
        {

        }catch(Exception e)
        {
            e.printStackTrace();
        }

        //Client.setController(ControllerFactory.getController(id,pwd));
    }
    @FXML
    protected void onRegisterButtonClick() {
        nameField.setText("这是注册按钮");
    }

}